{% extends 'base.html' %}
{% block styles%}
<style type="text/css">
    header{
        background-color: #eee;
        height: 7rem;
    }
    header h1{
        font-size: 3rem;
    }
    .mynav{
        margin-bottom: 0 !important;
    }
    .mybtn{margin: 20px 0px}
    th{background-color: #eee;}
</style>
 {% endblock %}
 {% block title%}
    <title>主界面</title>
{% endblock %}
{% block nav %}
    <li><a href="/logout"><span class="glyphicon glyphicon-log-out"></span> 退出登录</a></li>
{% endblock %}
{% block content %}
<header>
<div class="container">
    <h1>视频管理</h1>
</div>
</header>
<!-- 按钮组 -->

<div class="container mybtn">

<a href="/add_video?id={{data.c_id}}" class="btn btn-info">
          <span class="glyphicon glyphicon-plus"></span> 添加
        </a>

</div>
<!-- 表格 -->
<div class="container table-responsive text-center">
<table class="table table-bordered table-hover">
  <caption>边框表格布局</caption>
  <thead class="text-center">
    <tr>
      <th class="text-center">序号</th>
      <th class="text-center">名称</th>
      <th class="text-center">介绍</th>
      <th class="text-center">讲师</th>
      <th class="text-center">播放次数</th>
      <th class="text-center">时长</th>
      <th class="text-center">编辑</th>
      <th class="text-center">删除</th>
    </tr>
  </thead>
  <tbody>
     {% for item in data.videos %}
    <tr>
      <td>{{loop.index}}</td>
      <td>{{item.title}}</td>
      <td>{{item.abstract}}</td>
      <td>{{data.teachers[loop.index-1]}}</td>
      <td>{{item.hits}}</td>
      <td>{{item.time}}</td>
      <td>
          <a href="/video_edit?id={{item.id}}">
            <span class="glyphicon glyphicon-edit"></span>
        </a>
      </p>
      </td>
      <td>
          <a href="/commit_delete_video?id={{item.id}}">
            <span class="glyphicon glyphicon-trash"></span>
          </a>
      </td>
    </tr>
   {% endfor %}
  </tbody>
  </div>
{% endblock %}
{% block script %}
<!-- {{url_for('static',filename='courses')}} -->
<script type="text/javascript" src="/static/course.js" id='jss'></script>
{% endblock %}